package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurchaseStorageMapper;
import com.ruoyi.system.domain.PurchaseStorage;
import com.ruoyi.system.service.IPurchaseStorageService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采购入库记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class PurchaseStorageServiceImpl implements IPurchaseStorageService 
{
    @Autowired
    private PurchaseStorageMapper purchaseStorageMapper;

    /**
     * 查询采购入库记录
     * 
     * @param storageId 采购入库记录主键
     * @return 采购入库记录
     */
    @Override
    public PurchaseStorage selectPurchaseStorageByStorageId(Long storageId)
    {
        return purchaseStorageMapper.selectPurchaseStorageByStorageId(storageId);
    }

    /**
     * 查询采购入库记录列表
     * 
     * @param purchaseStorage 采购入库记录
     * @return 采购入库记录
     */
    @Override
    public List<PurchaseStorage> selectPurchaseStorageList(PurchaseStorage purchaseStorage)
    {
        return purchaseStorageMapper.selectPurchaseStorageList(purchaseStorage);
    }

    /**
     * 新增采购入库记录
     * 
     * @param purchaseStorage 采购入库记录
     * @return 结果
     */
    @Override
    public int insertPurchaseStorage(PurchaseStorage purchaseStorage)
    {
        return purchaseStorageMapper.insertPurchaseStorage(purchaseStorage);
    }

    /**
     * 修改采购入库记录
     * 
     * @param purchaseStorage 采购入库记录
     * @return 结果
     */
    @Override
    public int updatePurchaseStorage(PurchaseStorage purchaseStorage)
    {
        return purchaseStorageMapper.updatePurchaseStorage(purchaseStorage);
    }

    /**
     * 批量删除采购入库记录
     * 
     * @param storageIds 需要删除的采购入库记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseStorageByStorageIds(String storageIds)
    {
        return purchaseStorageMapper.deletePurchaseStorageByStorageIds(Convert.toStrArray(storageIds));
    }

    /**
     * 删除采购入库记录信息
     * 
     * @param storageId 采购入库记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseStorageByStorageId(Long storageId)
    {
        return purchaseStorageMapper.deletePurchaseStorageByStorageId(storageId);
    }
}
